#ifndef INCLUDE_APHW_CURSOR_HPP
#define INCLUDE_APHW_CURSOR_HPP

#include <boost/shared_ptr.hpp>
#include <ham/hamsterdb.h>

#include <aphw/Key.hpp>
#include <aphw/Record.hpp>

namespace aphw
{

class Database;

class Cursor
{
public:
    Cursor(Database&);

    bool open() const;
    void close();

    ham_cursor_t* cur();
    ham_key_t* key();
    ham_record_t* rec();

    Key getKey();
    GetRecord getRecord();

private:
    struct Body;
    boost::shared_ptr<Body> body_;
};

void init_Cursor();

}

#endif
